using System;
using System.Collections.Generic;
using System.Text;

namespace WowGuildSite.Armory
{
    public class ArmoryRangedStats
    {
        private ArmoryCharacter character;

        public ArmoryCombatStat Ranged
        {
            get
            {
                return ArmoryCombatStat.FromElement(character.SheetDocument.GetElement("/page/characterInfo/characterTab/ranged/damage"),
                                               character.SheetDocument.GetElement("/page/characterInfo/characterTab/ranged/weaponSkill"));
            }
        }

        public decimal          CritChance
        {
            get
            {
                return character.SheetDocument.GetAttributeDecimal("/page/characterInfo/characterTab/ranged/critChance/@percent");
            }
        }

        public int              HitRating
        {
            get
            {
                return character.SheetDocument.GetAttributeInt("/page/characterInfo/characterTab/ranged/hitRating/@value");
            }
        }

        public int              PowerBase
        {
            get
            {
                return character.SheetDocument.GetAttributeInt("/page/characterInfo/characterTab/ranged/power/@base");
            }
        }

        public int              PowerEffective
        {
            get
            {
                return character.SheetDocument.GetAttributeInt("/page/characterInfo/characterTab/ranged/power/@effective");
            }
        }

        internal ArmoryRangedStats( ArmoryCharacter character )
        {
            if (character == null)
            {
                throw new ArgumentNullException("character");
            }

            this.character = character;
        }
    }
}
